<?php 
     $icon_country = Engine_Api::_()->getApi('settings','core')->getSetting('webmix.icon.country','http://demo.idragonsolution.com/webmix/application/modules/Core/externals/images/report.png');
     $icon_homepage = Engine_Api::_()->getApi('settings','core')->getSetting('webmix.icon.homepage','http://demo.idragonsolution.com/webmix/application/modules/Core/externals/images/star_big.png')
?>
<style>
    /*fix site width*/
/*
.layout_page_header .layout_main {
    width: 1000px;
    text-align: right;
    margin: 0px auto 0px auto;
}

.layout_core_menu_main {
    width: 1000px;
    margin: 0px auto 0px auto;
    text-align: left;
    overflow: hidden;
    background-color: #464646;
    background-repeat: repeat-x;
    border: none;
    border-left: none;
    border-right: none;
    -moz-border-radius: 4px;
    -webkit-border-radius: 4px;
    border-radius: 4px;
    -moz-box-shadow: inset 0px 0px 3px rgba(0, 0, 0, .5);
    padding: 1px;
}*/
#global_content {
    width: 970px;
    margin: 0px auto 0px auto;
    overflow: hidden;
    min-height: 500px;
	padding-left: 35px;
	background-color: #FFFFFF;
	border: 1px solid #DEDEDE;
	padding-top: 35px;
}
.menucontext{
    position: absolute;
    width:222px;
    height:182px;
    
    background: url(<?php echo $this->baseUrl()?>/application/modules/Webmix/externals/images/webmix/menucontext.png) no-repeat;
}
.menucontext_title{
    color: white;
    padding-left: 25px;
    padding-bottom: 5px;;
}
.menucontext_item{
    height: 24px;
    width: auto;
    margin-left: 10px;
    margin-right: 10px;
    padding-left: 15px;
    
}
.menucontext_item:hover{
    background: #4d73b0;
    color:white;
}
.menucontext_close{
    position: absolute;
    top: 0px;
    right: 0px;
    width: 20px;
    height: 20px;
    display: block;
    cursor: pointer;
    line-height: 1.7px;
}
.menucontext_item .menucontext_item_item:hover{
    color:white;
    text-decoration: none;
}
.webmix_list_country{
    display: none;
    float: left;
    background: #e1e9f4;
    position: absolute;
    top: 16px;
    right: 0px;
    border: 1px solid;
    padding: 10px;
    padding-top:5px;
    z-index: 999;  
    border-radius:4px;
    -moz-border-radius:4px;
    
    -moz-border-radius-topleft:4px;
	-moz-border-radius-topright:4px;
    -moz-border-radius-bottomleft:4px;
	-moz-border-radius-bottomright:4px;
	-webkit-border-top-left-radius:4px;
	-webkit-border-top-right-radius:4px;
    -webkit-border-bottom-left-radius:4px;
	-webkit-border-bottom-right-radius:4px;
}
a.webmix_country:hover{
    text-decoration: none;
}
.webmix_country:hover .webmix_list_country{
    display:block;
}
.webmix_list_country_item{
    float: left;
    padding-left: 5px;

}
.webmix_country_container:hover .webmix_list_country{
    display:block;
}
.webmix_list_country img.active{
    border:2px solid blue; 
    height:14px;
}
.webmix_list_country_item:hover img{
     border:2px solid blue; 
    height:14px;
}
.webmix_list_country_label{
    font-weight: bold;
}
.menucontext_item_item{
    width: 182px;
    
    float: left;
}
.webmix_country{
	background: url("<?php echo $icon_country?>") no-repeat;    
}
.sethomepage{
	background: url("<?php echo $icon_homepage?>") no-repeat;
margin-right: 33px;	   
}
/*.lock_webmix_system{
    background: url("<?php echo $this->baseUrl()?>/application/modules/Webmix/externals/images/webmix/lock.png") repeat scroll 0 0 transparent;
    color: red;
    display: block;
    height: 45px;
    position: absolute;
    right: 0;
    top: -27px;
    width: 15px;
}*/

#dialog-set-homepage {
height: 370px!important;
width: 700px!important;
margin:0px;
}
div.dialog-header {
background: #4D73B0;
margin-bottom: 20px;
padding: 6px 20px 5px 20px;
-webkit-border-top-left-radius: 4px;
-webkit-border-top-right-radius: 4px;
-moz-border-radius-topleft: 4px;
-moz-border-radius-topright: 4px;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
}
div.dialog-header h1 {
color: white;
text-shadow: 0 1px 0 #313131;
font-size: 16px;
font-weight: bold;
margin: 0;
}
div.dialog-header .overlay-options {
position: absolute;
top: 5px;
right: 5px;
}
.overlay-option.help {
margin: 0 0 0 2px;
width: 27px;
background-position: 0 0;
right: 32px;
}
.overlay-option {

height: 17px;
position: absolute;
top: 0;
overflow: hidden;
text-indent: -999px;
}
div.dialog div.dialog-content {
padding: 0 20px;
}
.dialog-content-inner-left {
float: left;
width: 380px;
padding: 0 20px 0 0;
}
.dialog-content-inner-left h1, .dialog-content-inner-right h1 {
color: #6A6A6A;
font-size: 16px!important;
font-weight: bold!important;
margin: 0 0 15px 0;
}
div.dialog p {
margin: 0 0 10px 0;
}
address, caption, cite, code, dfn, em, strong, th, var {
font-style: normal;
font-weight: normal;
}
</style>



<?php 
    $this->headScript()->appendFile($this->baseUrl() . '/application/modules/Webmix/externals/scripts/webmix.js');
    $this->headScript()->appendFile($this->baseUrl() . '/application/modules/Webmix/externals/scripts/dropdown.js');
    $this->headScript()->appendFile($this->baseUrl() . '/application/modules/Webmix/externals/scripts/translate.js');
    $country_color = Engine_Api::_()->getApi('settings','core')->getSetting('webmix.countriescolor.color','#5F93B4');
    $create_color = Engine_Api::_()->getApi('settings','core')->getSetting('webmix.createcolor.color','#153665');
  
?>

<a style="float: right;padding-left: 20px;/*background: url(application/modules/Core/externals/images/star_big.png) no-repeat*/" class="sethomepage" href="javascript:void(0)" onclick=" showDefaultBrowse();$('container_dialog_set_homepage').style.display='block';"><span style="color: <?php echo $country_color?> ;"><?php echo $this->translate('Set as Homepage')?></span></a>
<div style="position:relative; float:right; margin-right: 15px;" class="webmix_country_container">
<a style="float: right;padding-left: 20px; /* background: url(application/modules/Core/externals/images/report.png) no-repeat*/" class="webmix_country" href="javascript:void(0);"><span style="color: <?php echo $country_color?> ;"><?php echo $this->translate('Country')?></span>
</a>
<?php
        $countryTable = Engine_Api::_()->getDbtable('countries','webmix');
        $countries = $countryTable->getCountryByUser($this->viewer->user_id);
        $total = $countries->count();
        $width =    $total*28;
        if($width<134) $width = 134;
    ?>
<div class="webmix_list_country" style="width:<?php echo  $width?>px;">
    <div class="webmix_list_country_label"> <?php echo $this->translate('Select your country')?> </div>
        
    <?php foreach ($countries as $item):?>
        <a title ="<?php echo $item->title;?>"class="webmix_list_country_item" onclick="window.location.href='<?php echo $this->url(array( 'wbc'=>$item->getWebmixId()),'webmix_special',true)?>'">
            <img id="country_id_<?php echo $item->key?>" src="<?php echo $this->baseUrl()?>/application/modules/Webmix/externals/images/flag/<?php echo strtolower($item->key)?>.png"  alt="<?php echo $item->title?>"/>
        </a>
    <?php endforeach; ?>
</div>

</div>
<a style="float: right;padding-left: 20px;margin-right: 20px; background:url(application/modules/Core/externals/images/help.png) no-repeat" class="webmix_help" href="http://www.gaygirlsconnect.com/pages/webmix-help"><span style="color: <?php echo $country_color?> ;"><?php echo $this->translate('Help')?></span>
</a>
<a onclick="javascript:void(0);" style="color: #153665; display: block;height: 21px; line-height: 7px;  margin-left: -2px; font-size: 14px; text-decoration: none;">
<h2 class="webmix_header" style="color: <?php echo $create_color?>; font-weight: bold; ">
  <?php echo $this->translate('Create your own Webmix') ?>
</h2>
</a>

<?php if( count($this->navigation) ): ?>
  <div class='tabs'>
    <?php
      // Render the menu
      //->setUlClass()
      echo $this->navigation()->menu()->setContainer($this->navigation)->render()
    ?>
  </div>
<?php endif; ?>
<?php echo $this->partial('tab.tpl','webmix',array('webmixs'=>$this->webmixs)) ?>
<div class="webmix_tab_command">
    <span class="webmix_tab_command-option rename" onclick="showPopupEditWebmixName();"><?php echo $this->translate('Rename webmix') ?></span>
    <span class="webmix_tab_command-option delete" onclick="showPopupDeleteWebmix();"><?php echo $this->translate('Delete webmix') ?></span>
    <span class="webmix_tab_command-option default" id="el_setdefault_webmix" onclick="setDefaultWebmix();"><?php echo $this->translate('Set default') ?></span>
    <span class="webmix_tab_command-option"  style="display: none;" onclick="setAdminDefaultWebmix();"><?php echo $this->translate('Set admin default') ?></span>
    
</div>
<div class="webmix_view_content">
    <?php $lst_ids = array(); $lstparent = array();?>
    <?php $default = 1;
        $default_webmix = 0;
    ?>
   <?php foreach($this->webmixs as $webmix):?> 
       <?php $lst_ids[] = $webmix->webmix_id;
            if(!empty($webmix->default)){
                if(empty($default_webmix) ) $default_webmix = $webmix->webmix_id;
                else {
                    if($webmix->type == 'user') $default_webmix = $webmix->webmix_id;
                }
            }
       ?>
       <?php $lstparent[$webmix->webmix_id] = $webmix->parent_id; ?>
       <div class="desktop editable webmix_custom_content_js" id="content-<?php echo $webmix->webmix_id?>"  style="display: block;">
            <div class="grid fix_main_webmix" style="margin-left:0px;">
                <?php echo $this->partial('webmix_tab.tpl','webmix',array('webmix_id'=>$webmix->webmix_id,'default'=>$default,'parent'=>$webmix->parent_id,'type'=>$webmix->type)) ?>
                <?php $default = 0;?>
            </div>
        </div>
    <?php endforeach;?>
</div>
<div class="menucontext" id="menucontext" style="display:none">
    <ul>
        <li class="menucontext_title"><?php echo $this->translate('Edit Block')?></li>
        <li class="menucontext_item"  ><a  id="menucontext_item_edit_open" href="javascript:void(0);" class="menucontext_item_item open"><?php echo $this->translate('Open Block') ?></a></li>
        <li class="menucontext_item"  ><a  id="menucontext_item_edit_edit" href="javascript:void(0);" class="menucontext_item_item edit smoothbox"><?php echo $this->translate('Edit Block') ?></a></li>
         <li class="menucontext_item"  ><a  id="menucontext_item_edit_company" href="javascript:void(0);" class="menucontext_item_item company smoothbox"><?php echo $this->translate('Edit Company') ?></a></li>
       
       <!-- <li class="menucontext_item"  ><a  id="menucontext_item_edit_copypass" href="javascript:void(0);" class="menucontext_item_item copypass smoothbox"><?php echo $this->translate('Copy/Pass') ?></a></li> -->
        <li class="menucontext_item"  ><a  id="menucontext_item_edit_delete" href="javascript:void(0);" class="menucontext_item_item delete smoothbox"><?php echo $this->translate('Delete') ?></a></li>
      
    </ul>
    <span class="menucontext_close" id="menucontext_close"></span>
</div>
<div id="webmix_link_for_open_link" style="display:none;"><a id="webmix_link_for_open_link_a" target="_blank"></a></div>

<div class="dialog"  id="container_dialog_set_homepage">
    <div id ="dialog-set-homepage" class="webmix_dialog_sethomepage">
        <div class="dialog-header">
            <h1>Set as my home page</h1>
            <div class="overlay-options">
                   
    				<a href="javascript:void(0);" onclick="$('container_dialog_set_homepage').style.display='none';" class="cancel overlay-option">�</a>
            </div>
        </div>
        <div class="dialog-content" id="content_Chrome" style="display:none;">
                
    			<div class="dialog-content-inner-left">
                <h1>Set Gaygirlsconnect as homepage in Google Chrome</h1>
                    <p>1.) Click <strong>"Extra"</strong> in the menu of the browser (on the right)<br>
                    2.) Select <strong>"Options"</strong><br>
                    3.) Open the tab <strong>"basic settings"</strong><br>
                    4.) Type http://www.gaygirlsconnect.com/webmix at <strong>"startpage"</strong><br></p>
                </div>
                <div class="dialog-content-inner-right">
					<div id="browser_logos">
						<span title="ie" id="br_ie" onclick="changebrowseicon('content_MicrosoftInternetExplorer')" class="browser_logo "></span>
						<span title="firefox" id="br_firefox" class="browser_logo " onclick="changebrowseicon('content_Firefox')"></span>
						<span title="chrome" id="br_chrome" class="browser_logo active" onclick="changebrowseicon('content_Chrome')"></span>
						<span title="safari" id="br_safari" class="browser_logo" onclick="changebrowseicon('content_Safari')"></span>
						<span title="opera" id="br_opera" class="browser_logo" onclick="changebrowseicon('content_Opera')"></span>
						<div class="clearL"></div>
					</div>
					<div class="browser_image"></div>
			     </div>
			     <div class="clearL"></div>
    			 
        </div>
        <div class="dialog-content" id="content_Firefox" style="display:none;">
			<div class="dialog-content-inner-left">
                <h1>Set Gaygirlsconnect as homepage in Firefox</h1>
                <p>
                    Drag the logo below to the <strong>"home" </strong>button of your browser: <br>
                    <img src="<?php echo $this->baseUrl()?>/application/modules/Webmix/externals/images/webmix/sethomepage.png" style="margin: 5px 0 0 0;">
                    <br>
                    <a href="http://www.gaygirlsconnect.com/webmix" border="0" id="sethomepagelink">
                    <img src="<?php echo $this->baseUrl()?>/application/modules/Webmix/externals/images/webmix/icongaygirls.png" style="margin: 5px 0 0 0;"></a>
                </p>
            </div>
			<div class="dialog-content-inner-right">
					<div id="browser_logos">
						<span title="ie" id="br_ie" class="browser_logo" onclick="changebrowseicon('content_MicrosoftInternetExplorer')"></span>
						<span title="firefox" id="br_firefox" class="browser_logo active" onclick="changebrowseicon('content_Firefox')"></span>
						<span title="chrome" id="br_chrome" class="browser_logo" onclick="changebrowseicon('content_Chrome')"></span>
						<span title="safari" id="br_safari" class="browser_logo" onclick="changebrowseicon('content_Safari')"></span>
						<span title="opera" id="br_opera" class="browser_logo" onclick="changebrowseicon('content_Opera')"></span>
						<div class="clearL"></div>
					</div>
					<div class="browser_image"></div>
			</div>
			<div class="clearL"></div>
		</div>
    	<div class="dialog-content" id="content_MicrosoftInternetExplorer" style="display:none;">
			<div class="dialog-content-inner-left"><h1>Set Gaygirlsconnect as homepage in Internet Explorer</h1><p><a onclick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.gaygirlsconnect.com/webmix');" href="http://www.gaygirlsconnect.com/webmix">Click here</a> to set your GayGirlsConnect Webmix as your homepage in Internet Explorer.</p></div>
			<div class="dialog-content-inner-right">
					<div id="browser_logos">
						<span title="ie" id="br_ie" class="browser_logo active" onclick="changebrowseicon('content_MicrosoftInternetExplorer')"> </span>
						<span title="firefox" id="br_firefox" class="browser_logo" onclick="changebrowseicon('content_Firefox')"></span>
						<span title="chrome" id="br_chrome" class="browser_logo " onclick="changebrowseicon('content_Chrome')"></span>
						<span title="safari" id="br_safari" class="browser_logo " onclick="changebrowseicon('content_Safari')"></span>
						<span title="opera" id="br_opera" class="browser_logo " onclick="changebrowseicon('content_Opera')"></span>
						<div class="clearL"></div>
					</div>
					<div class="browser_image"></div>
			</div>
			<div class="clearL"></div>
		</div>		
    	<div class="dialog-content" id="content_Safari" style="display:none;">
			<div class="dialog-content-inner-left"><h1>Set Gaygirlsconnect as homepage in Safari</h1>
            <p>1.) Open <strong>"preferences"</strong> by clicking Apple + , (comma) on your keyboard<br>
                2.) Type http://www.gaygirlsconnect.com/webmix in the tab <strong>"general"</strong> at <strong>startpagina </strong>  <br></p></div>
			<div class="dialog-content-inner-right">
					<div id="browser_logos">
						<span title="ie" id="br_ie" onclick="changebrowseicon('content_MicrosoftInternetExplorer')" class="browser_logo "></span>
						<span title="firefox" id="br_firefox" onclick="changebrowseicon('content_Firefox')" class="browser_logo "></span>
						<span title="chrome" id="br_chrome" onclick="changebrowseicon('content_Chrome')" class="browser_logo "></span>
						<span title="safari" id="br_safari" onclick="changebrowseicon('content_Safari')" class="browser_logo active"></span>
						<span title="opera" id="br_opera" onclick="changebrowseicon('content_Opera')" class="browser_logo "></span>
						<div class="clearL"></div>
					</div>
					<div class="browser_image"></div>
			</div>
			<div class="clearL"></div>
		</div>
        <div class="dialog-content" id="content_Opera" style="display:none;">
			<div class="dialog-content-inner-left"><h1>Set Gaygirlsconnect as homepage in Opera</h1><p>1.) Click <strong>"extra"</strong> in the menu of the browser and open <strong>"preferences"</strong><br> 2.) Type in the tab <strong>"general"</strong> http://www.gaygirlsconnect.com/webmix under <strong>" homepage"</strong><br></p></div>
			<div class="dialog-content-inner-right">
					<div id="browser_logos">
						<span title="ie" id="br_ie" class="browser_logo " onclick="changebrowseicon('content_MicrosoftInternetExplorer')"></span>
						<span title="firefox" id="br_firefox" class="browser_logo " onclick="changebrowseicon('content_Firefox')"></span>
						<span title="chrome" id="br_chrome" class="browser_logo " onclick="changebrowseicon('content_Chrome')"></span>
						<span title="safari" id="br_safari" class="browser_logo " onclick="changebrowseicon('content_Safari')"></span>
						<span title="opera" id="br_opera" class="browser_logo active" onclick="changebrowseicon('content_Opera')"></span>
						<div class="clearL"></div>
					</div>
					<div class="browser_image"></div>
			</div>
			<div class="clearL"></div>
		</div>
    
    </div>
</div>
<script type="text/javascript">
    var webmix_Trasalte =  new webmix_tranlsate();
    webmix_Trasalte.addTranslate('cannotcreate','<?php echo $this->translate('You can not create a new block in this webmix. Click on the "Create +" Tab to create your own webmix.') ?>');
    var tab_custom = new webmix_tab('webmix_custom_tab_js','webmix_custom_content_js','active');
    tab_custom.showTabIndex(0);
    
    tab_custom.setListWebmix([<?php echo implode(',',$lst_ids) ?>]);
    tab_custom.listParent = <?php echo  Zend_Json::encode($lstparent);?>;
    var createLoading = function(){
        var loading = new Element('div',{
            'id':'loadingdesk',
            'html':'<div id="loadingdesk-inner"><img alt="Loading ..." src="<?php echo $this->baseUrl()?>/application/modules/Webmix/externals/images/webmix/page-loading.gif"><br>Loading ...</div>'
        });
        var height = getTotalHeight();
        var top = getH();
        top = top - 200;
        loading.inject($('global_page_webmix-index-index'));
        loading.style.height = height+'px';
        
        
    }
	createLoading();
    window.addEvent('domready',function(){
  	 
        var webmix_show  = Cookie.read('webmix_id');
        console.log(webmix_show);
        Cookie.dispose('webmix_id');
        
        if(webmix_show){
            var el = $('tab-'+webmix_show);
            if(el ) {
                tab_custom.showTab(el);
                tab_custom.scrollToEl(el);
                return;
            } 
            
        }
        
        var href = window.location.href ;
        if(href.contains('webmix/')) {
            var t = href.split('webmix/');
            if(t.length > 0){
                var length = t.length;
                var id = t[length-1].split('/');
                var webmix_id = id[0];
                if(!isNaN(webmix_id))  {
                    var el = $('tab-'+webmix_id);
                    if(el ) {
                        tab_custom.showTab(el);
                        tab_custom.scrollToEl(el);
                        return;
                    }
                }   //tab_custom.showTabByWebmix_id(webmix_id);
            }
        }
        if(href.contains('wbc/')){
            var t = href.split('wbc/');
            if(t.length > 0){
                var length = t.length;
                var id = t[length-1].split('/');
                var webmix_id = id[0];
                if(!isNaN(webmix_id))  {
                    var el = $('tab-'+<?php if(!empty($this->rendertab)) echo $this->rendertab; else echo 0 ?>);
                    if(el){
                        tab_custom.showTab(el);
                        tab_custom.scrollToEl(el);
                        return;
                    } 
                    
                }  // tab_custom.showTabByWebmix_id(webmix_id);
            }
        }
        
        var default_webmix = <?php echo $default_webmix ;?>;
        if(default_webmix > 0){
            var el = $('tab-'+default_webmix);
            if(el ) {
                tab_custom.showTab(el);
                tab_custom.scrollToEl(el);
                showSetDefault.delay(500,null,1);
                return;
            } 
        }
        
        
    });
    $('menucontext_close').addEvent('click',function(){
        menucontext.hiddenContainer();
    });
    menucontext = new Dropdown($('menucontext'),null,$$('a.smark'),'contextmenu','mouseout',<?php echo $this->viewer->user_id?>,<?php  if($this->viewer->isAdmin()) echo 1; else echo 0?>);
    window.addEventListener('contextmenu',function(e){
       var target = e.target;
       if(!target.hasClass('custommenucontext')){
            e.preventDefault();
            menucontext.hiddenContainer();
       }
    },false);
    window.addEventListener('click',function(e){
       if(menucontext){
            menucontext.hiddenContainer();
       }
             
       
    },false);
    /*function setHomePage(){
    	if (document.all) {
	    	document.body.style.behavior='url(#default#homepage)';
	    	document.body.setHomePage(znConfig.SITE_URL);
    	} else {
    		alert("<?php echo $this->translate('Select Tools > Option > Main > Use Current Page (Alt+C) to set Homepage')?>");
    	}
    }*/

    function detectedBrowseName(){

	var nVer = navigator.appVersion;
	var nAgt = navigator.userAgent;
	var browserName  = navigator.appName;
	var fullVersion  = ''+parseFloat(navigator.appVersion); 
	var majorVersion = parseInt(navigator.appVersion,10);
	var nameOffset,verOffset,ix;

	// In Opera, the true version is after "Opera" or after "Version"
	if ((verOffset=nAgt.indexOf("Opera"))!=-1) {
	 browserName = "Opera";
	 fullVersion = nAgt.substring(verOffset+6);
	 if ((verOffset=nAgt.indexOf("Version"))!=-1) 
	   fullVersion = nAgt.substring(verOffset+8);
	}
	// In MSIE, the true version is after "MSIE" in userAgent
	else if ((verOffset=nAgt.indexOf("MSIE"))!=-1) {
	 browserName = "MicrosoftInternetExplorer";
	 fullVersion = nAgt.substring(verOffset+5);
	}
	// In Chrome, the true version is after "Chrome" 
	else if ((verOffset=nAgt.indexOf("Chrome"))!=-1) {
	 browserName = "Chrome";
	 fullVersion = nAgt.substring(verOffset+7);
	}
	// In Safari, the true version is after "Safari" or after "Version" 
	else if ((verOffset=nAgt.indexOf("Safari"))!=-1) {
	 browserName = "Safari";
	 fullVersion = nAgt.substring(verOffset+7);
	 if ((verOffset=nAgt.indexOf("Version"))!=-1) 
	   fullVersion = nAgt.substring(verOffset+8);
	}
	// In Firefox, the true version is after "Firefox" 
	else if ((verOffset=nAgt.indexOf("Firefox"))!=-1) {
	 browserName = "Firefox";
	 fullVersion = nAgt.substring(verOffset+8);
	}
	// In most other browsers, "name/version" is at the end of userAgent 
	else if ( (nameOffset=nAgt.lastIndexOf(' ')+1) < 
			  (verOffset=nAgt.lastIndexOf('/')) ) 
	{
	 browserName = nAgt.substring(nameOffset,verOffset);
	 fullVersion = nAgt.substring(verOffset+1);
	 if (browserName.toLowerCase()==browserName.toUpperCase()) {
	  browserName = navigator.appName;
	 }
	}
	// trim the fullVersion string at semicolon/space if present
	if ((ix=fullVersion.indexOf(";"))!=-1)
	   fullVersion=fullVersion.substring(0,ix);
	if ((ix=fullVersion.indexOf(" "))!=-1)
	   fullVersion=fullVersion.substring(0,ix);

	majorVersion = parseInt(''+fullVersion,10);
	if (isNaN(majorVersion)) {
	 fullVersion  = ''+parseFloat(navigator.appVersion); 
	 majorVersion = parseInt(navigator.appVersion,10);
	}

	
	return browserName;
}
function showDefaultBrowse(){
    var dialog  = $$('.dialog-content');
    dialog.each(function(item){
        item.style.display = 'none';
    });
    
    var browsername = detectedBrowseName();
    var display_browsername = $('content_'+browsername);
    if(display_browsername) display_browsername.style.display = 'block';
}
showDefaultBrowse();
    
function changebrowseicon(name){
    var browsename = name.split('_');
    browsename = browsename[1];
    var el = $('content_'+browsename);
    var dialog  = $$('.dialog-content');
    dialog.each(function(item){
        item.style.display = 'none';
    });
    el.style.display = 'block';
}
</script>